<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      xmlns:layout="http://www.thymeleaf.org/extras/dialect"
      layout:decorate="layout/layout_info"
>
<head>
	<title>账号安全</title>
	<meta charset="utf-8"/>
	<link rel="stylesheet" href="../../static/asset/css/form.min.css" th:href="@{/asset/css/form.min.css}"/>
	<link rel="stylesheet" href="../../static/asset/css/common/front.css" th:href="@{/asset/css/common/front.css}"/>
	<link rel="stylesheet" href="../../static/asset/css/front/user-center.css" th:href="@{/asset/css/front/user-center.css}"/>
</head>
<body>
<div layout:fragment="content" th:remove="tag">
	<div class="container-fluid display-flex p-0" style="flex: 1 1;">
		<div class="row no-gutters w-100">
			<div class="col-12 col-md-2" th:insert="layout/menus::submenu(${menus},0,'Front_Base_Info')" style="background: #3c3c3c;">
			</div>

			<div class="col-12 col-md-10">
				<div class="row no-gutters">
					<div class="col-md-12">

						<div class="card">
							<div class="card-header">
								修改密码
							</div>
							<div class="card-body">
								<form action="#" th:action="@{/safety}" method="post" th:object="${password}" class="col-md-8 offset-md-2 col-lg-6 offset-lg-3">
									<div class="form-group row">
										<label for="originalPassword" class="col-sm-3 col-form-label">原密码</label>
										<div class="col-sm-9">
											<input type="password" class="form-control" id="originalPassword" name="originalPassword" placeholder="原密码"
											       required data-msg-required="不能为空">
											<div class="form-control-feedback text-danger" th:errors="*{originalPassword}"></div>
										</div>
									</div>
									<div class="form-group row">
										<label for="newPassword" class="col-sm-3 col-form-label">新密码</label>
										<div class="col-sm-9">
											<input type="password" class="form-control" id="newPassword" name="newPassword" placeholder="新密码"
											       required data-msg-required="不能为空" data-rule-minlength="6" data-msg-minlength="不能少于6位">
											<div class="form-control-feedback text-danger" th:errors="*{newPassword}"></div>
										</div>
									</div>
									<div class="form-group row">
										<label for="confirmPassword" class="col-sm-3 col-form-label">确认密码</label>
										<div class="col-sm-9">
											<input type="password" class="form-control" id="confirmPassword" placeholder="重新输入一次新密码"
											       required data-msg-required="不能为空" data-rule-equalTo="#newPassword" data-msg-equalTo="两次输入不一致">
										</div>
									</div>

									<div class="row">
										<div class="offset-md-3 col-md-4 col-12">
											<button type="submit" class="btn btn-primary btn-block">提交</button>
										</div>
									</div>
								</form>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>


<th:block layout:fragment="script">
	<script type="text/javascript" src="../../static/asset/js/form.min.js" th:src="@{/asset/js/form.min.js}"></script>
	<script type="text/javascript" src="../../static/asset/js/app.js" th:src="@{/asset/js/app.js}"></script>
	<script type="text/javascript">
        $(function () {
            $('form').validate({
                errorElement: 'div',
                errorClass: 'form-control-feedback text-danger'
            })
        })
	</script>
</th:block>
</body>
</html>
